 <%@ taglib prefix="s" uri="/struts-tags"%> 
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
 <link href="../../../js/thickbox.css" rel="stylesheet" type="text/css" />
      <script src="../../../js/jquery-1.5.min.js" type="text/javascript"></script>
      <script src="../../../js/jqtool.js" type="text/javascript"></script>
      <script src="../../../js/ui.js" type="text/javascript"></script>
      <script src="../../../js/thickbox-compressed.js" type="text/javascript"></script>
<script src="../../../js/jqui/jquery-1.2.6.min.js" type="text/javascript"></script>
 	   <link href="../../../css/Public.css"type="text/css" rel="stylesheet" />
       <link href="../../../css/PublicEdit.css"type="text/css" rel="stylesheet" /> 
<title>新增分辨率 </title>
<script>
			function checkData()
			{					
					//验证数据   新用户名称
					var uname= window.document.getElementById("resolutioninfo_username").value;
					var str="false";	
			        if(uname!=null && uname!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(uname.length>10)
			        	{
			        	 	alert("分辨率内容长度过长，最长10位！");
			           		window.event.returnValue = false;
			            	return;
			        	}	 
			         	 $.ajaxSettings.async = false;
							  $.getJSON("/admin/json/isexsistResolution?resolution=" + uname+"&rnd="+Math.random(), function(data) {
						  	 if(data.str=='Y'){
						  		alert("该分辨率已经存在！");
						  		str="true";
						 	}
							}); 
							if(str=='true'){
							window.event.returnValue = false;
							return ;
							}  	
			        }
			        else
			        {            
			            alert("请输入分辨率名称！");
			            window.event.returnValue = false;
			            return;
			        }				     	        		      
			}	
			function isInt(str)
			{
				//var reg = /^(-|\+)?\d+$/ ;
				if(str==0)return true;
				var reg = /^[1-9]\d*$/;	
				return reg.test(str);			
			}					
 </script>		
</head>
<body >
<form action="SaveResolution" method="post" >
				<div>
		                <div class="l_f_top">
		                    <div class="l_f_top_left_div"><img alt="" src="../../../images/tb.gif" width="16" height="16" /></div>
		                    <div class="l_f_top_right_div">新增分辨率        </div>
		                </div>
		                <div class="l_f_body"> 		                 
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                            分辨率:</div>
		                        <div class="l_f_body_div5">
				                       <input type="text"  name ="resolutioninfo.resolution" id="resolutioninfo_username" style="width:150px"/>  
					           </div>                      
		                    </div>	 
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              状态:</div>
		                        <div class="l_f_body_div5" >
		               		     <select name="resolutioninfo.isshow" id="resolutioninfo_isshow" style="width: 120px">
									<option value="0">
										关闭
									</option>								
									<option value="1" selected>
										开放
									</option>							
								</select>
							   </div>
		                    </div>
		                     <div class="center l_f_body_foot">			                     
		                       <input type="submit" id="button" name="button" class="button2_60" onclick="checkData();"  value="提交"/>		                      
		                      <input type="button" class="button2_60"  onclick="javascript:history.go(-1);" value=" 返回"/> 
		                 </div>
		                </div>
			    	</div> 
</form>
</body>
</html>